package com.lhs.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.lhs.Result.Result;
import com.lhs.entity.blog.blog_cover;
import com.lhs.service.blog_coverService;
import com.lhs.mapper.blog_coverMapper;
import org.springframework.stereotype.Service;

/**
* @author 15977
* @description 针对表【blog_cover】的数据库操作Service实现
* @createDate 2025-09-11 09:04:15
*/
@Service
public class blog_coverServiceImpl extends ServiceImpl<blog_coverMapper, blog_cover>
    implements blog_coverService{

   @Override
public Result<blog_cover> getBlogCover(Long postId) {
    if (postId == null) {
        return Result.error("postId不能为空");
    }

    blog_cover blogCover = this.getOne(new QueryWrapper<blog_cover>().eq("post_id", postId));
    if (blogCover == null) {
        return Result.success(null);
    }

    return Result.success(blogCover.getCover());
}

}




